import { defineStore } from 'pinia'
import type { KnowledgeHubState } from './helper'
import { getLocalKnowledgeHubState } from './helper'

import type { IPdfMeta } from '@/views/pdf/DataModel'
export const useLocalKnowledgeHubState = defineStore('knowledgeHub-store', {
  state: (): KnowledgeHubState => getLocalKnowledgeHubState(),

  actions: {
    // updateLocalKnowledgeHubState(knowledgeHubStore: KnowledgeHubState) {
    //   // setLocalKnowledgeHubState(knowledgeHubStore)
    // },
    updatePdfSrc(pdfSrc: string) {
      this.pdfSrc = pdfSrc
    },
    updatePdfMeta(pdfMeta: IPdfMeta) {
      this.pdfMeta = pdfMeta
    },
    updatePdfid(pdfod: number | bigint) {
      this.pdfid = pdfod
    },
    getPromptList() {
      return this.$state
    },
  },
})
